package com.sky.wsp.mybatis.plus.config.properties;

import org.springframework.boot.context.properties.ConfigurationProperties;

import java.util.List;


/**
 * 数据权限配置类
 *
 * @author wangshaopeng@talkweb.com.cn
 * @Date 2023-01-11
 */
@ConfigurationProperties(prefix = "data.permission")
public class DataPermissionProperties {
    /**
     * 是否开启数据权限拦截
     */
    private Boolean enable = true;

    /**
     * 数据创建人字段名
     */
    private String dataCreatorColumn = "creator";

    /**
     * 数据权限id字段名
     */
    private String dataPermissionIdColumn = "permission_id";

    /**
     * 需要进行数据权限id过滤的表名集合
     */
    private List<String> filterTables;

    /**
     * 需要忽略的多数据权限的表，此配置优先filterTables，若此配置为空则启用filterTables
     */
    private List<String> ignoreTables;

    /**
     * 需要排除数据权限过滤的登录用户名
     */
    private List<String> ignoreLoginNames;

    public Boolean getEnable() {
        return enable;
    }

    public void setEnable(Boolean enable) {
        this.enable = enable;
    }

    public String getDataCreatorColumn() {
        return dataCreatorColumn;
    }

    public void setDataCreatorColumn(String dataCreatorColumn) {
        this.dataCreatorColumn = dataCreatorColumn;
    }

    public String getDataPermissionIdColumn() {
        return dataPermissionIdColumn;
    }

    public void setDataPermissionIdColumn(String dataPermissionIdColumn) {
        this.dataPermissionIdColumn = dataPermissionIdColumn;
    }

    public List<String> getFilterTables() {
        return filterTables;
    }

    public void setFilterTables(List<String> filterTables) {
        this.filterTables = filterTables;
    }

    public List<String> getIgnoreTables() {
        return ignoreTables;
    }

    public void setIgnoreTables(List<String> ignoreTables) {
        this.ignoreTables = ignoreTables;
    }

    public List<String> getIgnoreLoginNames() {
        return ignoreLoginNames;
    }

    public void setIgnoreLoginNames(List<String> ignoreLoginNames) {
        this.ignoreLoginNames = ignoreLoginNames;
    }
}
